package com.spy.material.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import com.spy.material.domain.PurchaseOrderDetail;
import org.apache.ibatis.annotations.Select;

/**
 * 采购明细Mapper接口
 *
 * @author twc
 * @date 2025-11-09
 */
@Mapper
public interface PurchaseOrderDetailMapper extends BaseMapper<PurchaseOrderDetail>
{
    /**
     * 查询采购明细
     *
     * @param id 采购明细主键
     * @return 采购明细
     */
    public PurchaseOrderDetail selectPurchaseOrderDetailById(Long id);

    /**
     * 查询采购明细列表
     *
     * @param purchaseOrderDetail 采购明细
     * @return 采购明细集合
     */
    public List<PurchaseOrderDetail> selectPurchaseOrderDetailList(PurchaseOrderDetail purchaseOrderDetail);

    /**
     * 新增采购明细
     *
     * @param purchaseOrderDetail 采购明细
     * @return 结果
     */
    public int insertPurchaseOrderDetail(PurchaseOrderDetail purchaseOrderDetail);

    /**
     * 修改采购明细
     *
     * @param purchaseOrderDetail 采购明细
     * @return 结果
     */
    public int updatePurchaseOrderDetail(PurchaseOrderDetail purchaseOrderDetail);

    /**
     * 删除采购明细
     *
     * @param id 采购明细主键
     * @return 结果
     */
    public int deletePurchaseOrderDetailById(Long id);

    /**
     * 批量删除采购明细
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deletePurchaseOrderDetailByIds(Long[] ids);

    @Select("select * from purchase_order_detail where purchase_order_id = #{purchaseOrderId}")
    List<PurchaseOrderDetail> getPurchaseOrderDetailByPurchaseOrderId(Long purchaseOrderId);
}